/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.upc.dew.egretel.service;

import pe.edu.upc.dew.egretel.dao.PersonaDao;
import pe.edu.upc.dew.egretel.dao.PersonaDaoJdbc;
import pe.edu.upc.dew.egretel.model.Persona;

/**
 *
 * @author Luis Tantaruna
 */
public class PersonaServiceImpl implements PersonaService {

    public Persona logeo(String login, String clave) {


        PersonaDao personaDao = new PersonaDaoJdbc();

        // BANDEJA: se deben cargar los reclamos que tenga asignado la persona
        Persona persona  = personaDao.getPersonaPorLoginName(login);

        return persona;

/*        Persona usuario  = null;

        if (login.equals("cliente") == true) {

            usuario = new Persona(10, "Pedro", "Venturo","4827896","","pventuro@yahoo.com",login, "123","C");

            usuario.getReclamos().add(new Reclamo("001", "Cobro indebido en Factura", "5374155", "Facturacion","18/10/2010 11:30", "Facturacion", "", new Persona(100, "Luis", "Alva","5374155","","lalva@yahoo.com",login, "1234","E"), new Persona(1, "Pedro", "Venturo","4827896","","pventuro@yahoo.com",login, "123","C"),"En Atencion"));

            usuario.getReclamos().add(new Reclamo("002", "Corte de Linea Basica", "2416688", "Averia","20/10/2010 16:30", "Planta","", new Persona(101, "Jorge", "Arce","2416688","","lalva@yahoo.com",login, "1234","E"), new Persona(1, "Pedro", "Venturo","4827896","","pventuro@yahoo.com",login, "123","C"),"En Atencion"));

        } else if (login.equals("lucho") == true) {

            usuario = new Persona(10, "Luis", "Alva","4827896","","pventuro@yahoo.com",login, "123","C");

            usuario.getReclamos().add(new Reclamo("003", "Facturacion de trafico retrazado", "5374155", "Facturacion","18/10/2010 11:30", "Facturacion","", new Persona(100, "Cesar", "Suarez","5374155","","lalva@yahoo.com",login, "1234","E"), new Persona(1, "Pedro", "Venturo","4827896","","pventuro@yahoo.com",login, "123","C"),"En Atencion"));

            usuario.getReclamos().add(new Reclamo("004", "Robo de cable aereo", "2416688", "Averia","20/10/2010 16:30", "Planta","", new Persona(100, "Javier", "Salazar","5374155","","lalva@yahoo.com",login, "1234","E"), new Persona(1, "Pedro", "Venturo","4827896","","pventuro@yahoo.com",login, "123","C"),"En Atencion"));
        } else {
            usuario = new Persona(10, "Lucia", "Aparicio","589647","","laparicio@yahoo.com",login, "123","C");
        }

        return usuario;*/

    }
}
